﻿using Dsl.Ped.Common.Converters;
using NUnit.Framework;

namespace DSLPedCommonTest.Converters
{
    [TestFixture]
    public class NegatedBoolConverterTest
    {
        private NegatedBoolConverter converter;

        [SetUp]
        public void SetUpForEachTest()
        {
            converter = new NegatedBoolConverter();
        }

        [Test, Description("Convert True/False, check negative result, without parameter")]
        public void NegatedBoolConverterWithoutParameterTest()
        {
            var obj = converter.Convert(true, typeof(bool), null, null);
            Assert.AreEqual(false, (bool)obj);

            obj = converter.Convert(false, typeof(bool), null, null);
            Assert.AreEqual(true, (bool)obj);
        }

        [Test, Description("Convert True/False, check negative result, with parameter")]
        public void NegatedBoolConverterWithParameterTest()
        {
            var obj = converter.Convert(true, typeof(bool), "xxx", null);
            Assert.AreEqual(false, (bool)obj);

            obj = converter.Convert(false, typeof(bool), "xxx", null);
            Assert.AreEqual(true, (bool)obj);
        }
    }
}
